home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 5 / chrpro3.zip / CPROPRTY.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  11KB  |  337 lines

  1. * Program CPROPRTY - Controls all Church Property Management Functions
  2. Set talk off
  3. Set bell off
  4. Clear
  5. Set deleted on
  6. Set intensity off
  7. Set exact off
  8. ? 'Now loading the CPROPRTY program.'
  9. Select secondary
  10. Use BDIRFILE index BDIRFILE
  11. Store 'January  February March    April    May      June     ' to MONTHS
  12. Store MONTHS+'July     August   SeptemberOctober  November December ' to MONTHS
  13. If $(DATE(),7,2) = '00'
  14.   Set date to 01,01,00
  15. ENDIF
  16.   Store ' ' to curmonthx
  17.   Store ' ' to curyear
  18.   Store ' ' to curmonth
  19.   * Set today's date from current system-date
  20.   Store $(date(),1,2) to curmo
  21.   Store $(date(),7,2) to curmonthx
  22.   Store val(curmo) to nmonth
  23.   Store curmo+curmonthx to indate
  24.   Store VAL(curmonthx) to CURYEAR
  25.   If $(date(),4,1) = '0'
  26.     Store $(DATE(),5,1) to CURMONTHX
  27.   else
  28.     Store $(DATE(),4,2) to CURMONTHX
  29.   endif
  30.   Store trim($(months,NMONTH*9-8,9)) to curmonth
  31.   Store curmonth+' '+curmonthx to curmonthx
  32.   Store ', 19'+$(DATE(),7,2) to CURYEAR
  33. GOTO 1
  34. Store trim($(SPACT,4,27)) to CHNAME
  35. SKIP
  36. Store $(SPACT,21,1) to D
  37. USE
  38. Select primary
  39. Store curmonthx+curyear to curdate
  40. Release months,curmonthx,curmonth,indate,nmonth,curmo,curyear
  41. Store d+':CPROPRTY' to MFILE
  42. Store T to LEVEL2
  43. Do while LEVEL2
  44.   Save to FMEMVARS
  45.   Erase
  46.   @ 0,1 say chname
  47.   @ 0,60 say curdate
  48.   @ 1,1  say 'DATA DISK = '+D
  49.   @ 2,21 say 'CHURCH PROPERTY MANAGER                 3-/CPROPRTY/'
  50.   @ 4,9 say  '1)  Add/edit church property items                    /CPRUPDAT/'
  51.   @ 5,9 say  '2)  Property full report '
  52.   @ 6,9 say  '3)  Property financial summary - by item type'
  53.   @ 7,9 say  '4)  Property checked out '
  54.   @ 8,9 say  '5)  Property due for service '
  55.   @ 9,9 say  '6)  Property short reports '
  56.   @ 10,15 say '6A)  by item name'
  57.   @ 11,15 say '6B)  by item type'
  58.   @ 12,15 say '6C)  by "used by"'
  59.   @ 13,15 say '6D)  by location'
  60.   @ 14,15 say '6E)  by "received by"'
  61.   @ 15,9 say  '7)  Start a new CPROPRTY file'
  62.   @ 16,9 say  '8)  Re-index the CPROPRTY file'
  63.   @ 17,9 say  '9)  Change the Names Directory (BDIRFILE)'
  64. ?
  65. Accept '         Select one of the above operations ("Q" = quit) ' to MSEL
  66. ?
  67. If !(MSEL)='DISK='
  68.   Store !($(MSEL,6,1)) to D
  69.   ? 'Disk now being set to drive',D
  70.   Save to FMEMVARS
  71. else
  72. Store F to validd1
  73. Store F to sreport
  74. Do while .NOT. validd1
  75.   Store T to validd1
  76.   Do CASE
  77.     CASE MSEL = '1'
  78.       Do CPRUPDAT.CMD
  79.     CASE MSEL = '2'
  80.       Store 99 to curline
  81.       Store D+':CPROPRTY' to mfile
  82.       ? 'Now printing the Full-Information report.'
  83.       Use &MFILE index &MFILE
  84.       Set format to print
  85.       Store 0 to pag
  86.       Do while .not. EOF
  87.         If curline>60
  88.           If curline<>99
  89.             EJECT
  90.           endif
  91.           Store pag+1 to pag
  92.           @ 2,1 say curdate
  93.    @ 2,20 say 'Church Property Report,  full-information       Page'+str(pag,4)
  94.           Store 5 to curline
  95.         endif
  96.        @ curline,0 say iname+' TYPE:'+itype+' LOCAT:'+ilocation+'USER:'+USED:BY
  97.        @ curline+1,5 say 'SERVICE:' get servdate
  98.        @ curline+1,21 say 'COST: $'+str(icost,8,2)+' RECVD:'+recvd:by+indate+;
  99.         ' BRAND:'+$(ibrand,1,8)
  100.         @ curline+2,0 say '#'+str(#,4)+' STATUS:'+status+' VALUE: $'+;
  101.         str(ivalue,10,2)+' OUT:'+chkd:out
  102.         STORE CURLINE+4 TO CURLINE
  103.       SKIP
  104.       ENDDO
  105.       eject
  106.       Set format to screen
  107.       ?
  108.       Accept 'End of report. Press <retn>' to xx
  109.     CASE MSEL='3'
  110.       Use &MFILE
  111.       Accept 'Enter a group code, or press <RETN> for all groups ' to xx
  112.       If !(XX)<>'Q'
  113.         Store d+':cprstat' to nfile
  114.         ? 'Now indexing the CPROPRTY file by STATUS field (group code).'
  115.         Set talk on
  116.         Index on $(status,1,1)+iname to &NFILE
  117.         Set talk off
  118.         Use &MFILE index &NFILE
  119.         Set format to print
  120.         Store 99 to cl
  121.         Store 0 to pagenum
  122.         Store T to valid2
  123.         Store ' ' to xhdr
  124.         If xx<>' '
  125.           Find &XX
  126.           If #=0
  127.             ? 'This group code not found in the CPROPRTY file. '
  128.             Store F to valid2
  129.           endif
  130.           Store ',  Group - '+$(status,1,1) to xhdr
  131.         endif
  132.         Store ' Property Financial Report'+xhdr to hdr
  133.         If valid2
  134.         Store 0 to pagenum
  135.         Store 99 to CL
  136.         Store 0.00 to xvalue
  137.         Do while .not. EOF
  138.           If cl>60
  139.             If cl<>99
  140.               EJECT
  141.             endif
  142.             Store pagenum+1 to pagenum
  143.             @ 1,1  say curdate+'     '+hdr+'      Page'+str(pagenum,4)
  144.             @ 4,1  say 'RECORD  LOCATION        ITEM           ITEM  '
  145.             @ 4,55 say 'CURRENT        ORIGINAL'
  146.             @ 5,1 say  'NUMBER                  TYPE           NAME  '
  147.             @ 5,55 say ' VALUE          VALUE  '
  148.             Store 7 to cl
  149.           endif
  150.         @ cl,0 say $(status,1,1)+str(#,5)+'   '+$(ilocation,1,15)+$(itype,1,10)
  151.         @ cl,35 say $(iname,1,16)+' $'+str(ivalue,10,2)+'    $'+str(icost,10,2)
  152.           Store CL+1 to CL
  153.           Store xvalue+ivalue to xvalue
  154.           SKIP
  155.         enddo
  156.        @ cl,1 say ;
  157. '-----------------------------------------------------------------------------'
  158.        @ cl+1,38 say 'TOTAL VALUE = $'+str(xvalue,10,2)
  159.        EJECT
  160.        endif
  161.        Set format to screen
  162.        Accept 'Report is complete. Press <return>' to xx
  163.     CASE MSEL='4'
  164.       Store ' - Property Checked Out' to tname
  165.       Store 'chkd:out<>"  "' to bname
  166.       Store T to sreport
  167.       Use &MFILE index &MFILE
  168.     CASE MSEL='5'
  169.       Store ' - Property Due for Service' to tname
  170.       Store $(date(),7,2)+$(date(),1,2)+$(date(),4,2) to bnamex
  171.       Store "SERVDATE<bnamex.and. servdate<>'  '" to bname
  172.       Store T to sreport
  173.       USE &MFILE index &MFILE
  174.     CASE !(MSEL)='6A'.or.!(MSEL)='6B'.or.!(MSEL)='6C'.or.!(MSEL)='6D'.or.;
  175.       !(MSEL)='6E'
  176.       Store T to sreport
  177.       Do CASE
  178.         CASE !(MSEL)='6A'
  179.           Store ' - by Item Name' to tname
  180.           Use &MFILE index &MFILE
  181.           Store 'sreport' to bname
  182.           Accept 'Enter a particular name (<retn> = ALL) ' to XX
  183.           If xx<>' '
  184.             Store 'iname=XX' to bname
  185.           endif
  186.         CASE !(MSEL)='6B'
  187.           Use &MFILE
  188.           Store d+':xfile' to NFILE
  189.           ? 'Now indexing by property type.'
  190.           Set talk on
  191.           Index on itype to &NFILE
  192.           Set talk off
  193.           Use &MFILE index &NFILE
  194.           Store ' - by Item Type' to tname
  195.           Store 'sreport' to bname
  196.           Accept 'Enter a particular "type" name (<retn> = ALL) ' to XX
  197.           If xx<>' '
  198.             Store 'itype=XX' to bname
  199.             Find &XX
  200.             If #=0
  201.               Accept 'This type name is not found. Press <retn>' to xx
  202.               Store F to sreport
  203.             endif
  204.           endif
  205.         CASE !(MSEL)='6C'
  206.           Use &MFILE
  207.           Store d+':xfile' to NFILE
  208.           ? 'Now indexing by property "used by".'
  209.           Set talk on
  210.           Index on used:by to &NFILE
  211.           Set talk off
  212.           Use &MFILE index &NFILE
  213.           Store 'sreport' to bname
  214.           Store ' - by item Used-By' to tname
  215.           Accept 'Enter a particular "used by" name (<retn> = ALL) ' to XX
  216.           If xx<>' '
  217.             Store 'used:by=XX' to bname
  218.             Find &XX
  219.             If #=0
  220.               Accept 'This "used by" name is not found. Press <retn>' to xx
  221.               Store F to sreport
  222.             endif
  223.           endif
  224.         CASE !(MSEL)='6D'
  225.           Use &MFILE
  226.           Store d+':xfile' to NFILE
  227.           ? 'Now indexing by property location.'
  228.           Set talk on
  229.           Index on ilocation to &NFILE
  230.           Set talk off
  231.           Use &MFILE index &NFILE
  232.           Store 'sreport' to bname
  233.           Store ' - by item Location' to tname
  234.           Accept 'Enter a particular name (<retn> = ALL) ' to XX
  235.           If xx<>' '
  236.             Store 'ilocation=XX' to bname
  237.             Find &XX
  238.             If #=0
  239.               Accept 'This type name is not found. Press <retn>' to xx
  240.               Store F to sreport
  241.             endif
  242.           endif
  243.         CASE !(MSEL)='6E'
  244.           Use &MFILE
  245.           Store d+':xfile' to NFILE
  246.           ? 'Now indexing by property "received by".'
  247.           Set talk on
  248.           Index on recvd:by to &NFILE
  249.           Set talk off
  250.           Use &MFILE index &NFILE
  251.           Store ' - by Item "Received by"' to tname
  252.           Store 'sreport' to bname
  253.           Accept 'Enter a particular name (<retn> = ALL) ' to XX
  254.           If xx<>' '
  255.             Store 'recvd:by=XX' to bname
  256.             Find &XX
  257.             If #=0
  258.           Accept 'This "received by" name is not found. Press <retn>' to xx
  259.               Store F to sreport
  260.             endif
  261.           endif
  262.         endcase
  263.     CASE MSEL = '7'  .or. MSEL='8'
  264.       If msel='7'
  265.         ? 'Now creating a new CPROPRTY file.'
  266.         Use CPROPRTX
  267.         Copy to &MFILE
  268.       else
  269.         ? 'Now re-indexing the CPROPRTY file.'
  270.       endif
  271.       USE &MFILE
  272.       Index on iname to &MFILE
  273.       Store d+':CPRLOCAT' to MFILE1
  274.       Index on ilocation to &MFILE1
  275.       Use
  276.       Accept 'CPROPRTY file is now complete. Press <retn>' to xx
  277.     CASE MSEL='9'
  278.       Select secondary
  279.       Use BDIRFILE index BDIRFILE
  280.       Store $(spact,4,27) to chname
  281.       SKIP
  282.       Store $(spact,21,1) to D
  283.       @ 19,8  say '            NAMES DIRECTORY EDITING                        '
  284.       Set intensity on
  285.       @ 21,12 say 'church    ' get chname
  286.       @ 22,12 say 'data disk ' get D
  287.       READ
  288.       Set intensity off
  289.       ? 'Now writing the above values into the Names Directory'
  290.       Replace spact with $(spact,1,20)+D
  291.       GOTO 1
  292.       Replace spact with $(spact,1,3)+chname
  293.       Use
  294.       Save to fmemvars
  295.       Select primary
  296.     CASE !(MSEL) = 'Q'
  297.       Store F to LEVEL2
  298.       RETURN
  299.     OTHERWISE
  300.       Accept 'Illegal selection. Please enter again ' to MSEL
  301.       Store F to validd1
  302.   ENDCASE
  303.   If sreport
  304.     ?
  305.     ? '         Property Report ',tname,'       ',curdate
  306.     ?
  307. ? 'record status   name            type      location  used by          value'
  308. ? '----- ------  -------------  ---------  ----------  ----------  ----------'
  309.     Do while (.not. (&bname)) .and. (.not. EOF)
  310.       SKIP
  311.     enddo
  312.     Do while &bname .and. .not. EOF
  313.       ? str(#,5),status,$(iname,1,15),$(itype,1,10),$(ilocation,1,10)
  314.       ?? used:by,'$',ivalue
  315.       SKIP
  316.       Do while .not. (&BNAME) .and. .not. EOF
  317.         SKIP
  318.       enddo
  319.     enddo
  320.     ?
  321.     Accept 'Report is complete. Press <RETURN>' to xx
  322.   endif
  323. endif
  324. ENDDO
  325. If MSEL<>'9'
  326.   Restore from FMEMVARS
  327. endif
  328. ENDDO
  329. RETURN
  330.  
  331.  
  332. 4 êCδ╙╞CδÑá╨**tè<t
  333. └t    Cδ∞╞Cδ│╞Jç┌èç┌ê╟Jç┌èç┌ê├è
  334. └u■═Z2└ç┌êç┌BêΦç┌êç┌
  335. └├è< t<    uCδ≤├è<'t
  336. <"t2└ó╨*├╞Có╨*├║ Rç┌èC:t■└KêC└╢ê┬┌èCè7ç┌Z2└├∙Z├î╚Φë┬Ä└╛Çë≈èÇ2φAⁿ≥ñÄ┌î╪Ä╨╝/î╚Ä╪║≥!░#┤%═!ΦD╗ë«ëáë░ëUΦΘú║: Φ╫÷║@Φ╤÷Θ$╗ë║]ΦÜ⌠Φq≈■└ó┬ó\╗ë ê╪ó╗Çáê
  337. └èCS■└╪Ç╫╞[║ Φc■Φ< rç╙╗· ΦÅ≤sΦ╢δ∞ë┘Cï π║ïFC╞KΦ─≤ç╙ëFt├╗ëF├ç┘è